﻿using System.Web.Mvc;
using System.Web.Routing;

namespace Qask.Web
{
    public class RouteConfig
    {
        public static void RegisterRoutes(RouteCollection routes)
        {
            routes.IgnoreRoute("{resource}.axd/{*pathInfo}");

            routes.MapRoute(
                name: "home-redirect",
                url: "home",
                defaults: new { controller = "Questions", action = "Create" });

            routes.MapRoute(
                name: "Ask",
                url: "questions/ask",
                defaults: new {controller = "Questions", action = "Create"});

            routes.MapRoute(
                name: "Default",
                url: "{controller}/{action}/{id}",
                defaults: new { controller = "Questions", action = "Index", id = UrlParameter.Optional }
            );
        }
    }
}
